This invention relates to processing pieces of artwork in a computer-graphics illustration.
Many items in everyday life exhibit some degree of transparency. For example, a car windshield is almost completely transparent. The tinted glass of a bottle is less transparent than a car windshield; however, a viewer can still make out objects behind the bottle.
Simulating transparency in a computer-generated images can consume large amounts of computer memory due to the amount of data needed to describe the image. For example, an image printed by a typical computer printer is made up of millions of colored dots roughly 0.005 inches in size. For each dot, a computer must determine a color based on the different transparent graphics overlapping the area covered by the dot. The process of determining these color is known as xe2x80x9ccompositing.xe2x80x9d
In general, in one aspect, the invention features a computer-based method of processing a computer graphics illustration having overlapping pieces of artwork. The method includes mapping pieces of artwork having a degree of transparency onto a grid, mapping at least a portion of an opaque piece of artwork onto the same grid, and determining whether the mapping of the opaque piece of artwork includes a grid cell included in the mapping of the one or more pieces of artwork having a degree of transparency. Based on the determining, the method excludes at least a portion of the opaque artwork from a flattening of at least some of the pieces of artwork.
Embodiments may include one or more of the following features. The flattening may include producing a planar map. The illustration may be associated with a first resolution and the grid may have a second resolution that is less than the first resolution. Excluding may include excluding the opaque piece of artwork if the opaque piece of artwork does not map to a grid cell also mapped by the one or more pieces of artwork having a degree of transparency. Excluding may include excluding portions of the opaque piece of artwork that correspond to portions that do not map to a grid cell also mapped by the one or more pieces of artwork having a degree of transparency. The method may further include outputting opaque pieces of artwork excluded from the planar map.
The mapping the one more pieces of artwork having a degree of transparency may include marking the grid using a rasterization engine function. The determining may include using a rasterization engine function blending mode.
In general, in another aspect, the invention features a computer program product, disposed on a computer readable medium, for processing a computer graphics illustration having overlapping pieces of artwork. The program includes instructions for causing a processor to map one or more pieces of artwork having a degree of transparency onto a grid, map at least a portion of an opaque piece of artwork onto the grid, and determine whether the mapping of the opaque piece of artwork includes a grid cell included in the mapping of the one or more pieces of artwork having a degree of transparency. Based on the determination, the program excludes at least a portion of the opaque artwork from a flattening of at least some of the pieces of artwork.
In general, in another aspect, a method of flattening an illustration having one or more pieces of illustration artwork includes mapping one or more artwork pieces having a first characteristic to a grid, mapping at least a portion of an artwork piece having a second characteristic to the grid, and determining whether the mapping of the artwork piece having the second characteristic covers a grid cell also covered by the mapping of the one or more artwork pieces having a first characteristic. The method further includes handling the artwork piece having the second characteristic in the flattening based on the determining.